package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.entity.MallMembersPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallMembersPackageMapper;

import com.ruoyi.mall.service.IMallMembersPackageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会员优惠中间表Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-25
 */
@Service
public class MallMembersPackageServiceImpl implements IMallMembersPackageService 
{
    @Autowired
    private MallMembersPackageMapper mallMembersPackageMapper;

    /**
     * 查询会员优惠中间表
     * 
     * @param id 会员优惠中间表ID
     * @return 会员优惠中间表
     */
    @Override
    public MallMembersPackage selectMallMembersPackageById(Long id)
    {
        return mallMembersPackageMapper.selectMallMembersPackageById(id);
    }

    /**
     * 查询会员优惠中间表列表
     * 
     * @param mallMembersPackage 会员优惠中间表
     * @return 会员优惠中间表
     */
    @Override
    public List<MallMembersPackage> selectMallMembersPackageList(MallMembersPackage mallMembersPackage)
    {
        return mallMembersPackageMapper.selectMallMembersPackageList(mallMembersPackage);
    }

    /**
     * 新增会员优惠中间表
     * 
     * @param mallMembersPackage 会员优惠中间表
     * @return 结果
     */
    @Override
    public int insertMallMembersPackage(MallMembersPackage mallMembersPackage)
    {
        mallMembersPackage.setCreateTime(DateUtils.getNowDate());
        return mallMembersPackageMapper.insertMallMembersPackage(mallMembersPackage);
    }

    /**
     * 修改会员优惠中间表
     * 
     * @param mallMembersPackage 会员优惠中间表
     * @return 结果
     */
    @Override
    public int updateMallMembersPackage(MallMembersPackage mallMembersPackage)
    {
        return mallMembersPackageMapper.updateMallMembersPackage(mallMembersPackage);
    }

    /**
     * 删除会员优惠中间表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMallMembersPackageByIds(String ids)
    {
        return mallMembersPackageMapper.deleteMallMembersPackageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员优惠中间表信息
     * 
     * @param id 会员优惠中间表ID
     * @return 结果
     */
    @Override
    public int deleteMallMembersPackageById(Long id)
    {
        return mallMembersPackageMapper.deleteMallMembersPackageById(id);
    }
}
